#define DEBUG
#include <cstdio>
#include <cstring>
#define MODS 1000000007
#define MAXLEN 18

using namespace std;

long long calc(int a[MAXLEN+1][2], int n) {
  long long ret=0;
  for (int i=1, j=n; i<=n && j>0; i++, j--) {
    long long x=1, y=1;
    if (i!=j) {
      x=(a[i][1]+a[i][0])*(a[i][1]-a[i][0]+1)/2%MODS;
      y=(a[j][1]+a[j][0])*(a[j][1]-a[j][0]+1)/2%MODS;
    } else {
      x=0;
      for (int k=a[i][0]; k<=a[i][1]; k++) {
	x=(x+k*k%MODS)%MODS;
      }
    }
    long long temp=1;
    for (int k=1; k<=n; k++) {
      if (k!=i && k!=j) {
	temp = temp*(a[k][1]-a[k][0]+1)%MODS;
      }
    }
    ret = (ret+x*y%MODS*temp%MODS)%MODS;
  }
  return ret;
}

long long count(long long n) {
  static int na[MAXLEN+1], range[MAXLEN+1][2];
  na[0]=0;
  for (; n>0; n/=10) {
    na[++na[0]] = n%10;
  }
  
  long long ret=0;
  for (int i=1; i<na[0]; i++) {
    range[i][0]=1, range[i][1]=9;
    ret = (ret+calc(range, i))%MODS;
    range[i][0]=0;
  }
  range[na[0]][0]=1, range[na[0]][1]=na[na[0]]-1;
  ret = ret+(calc(range, na[0]))%MODS;
  range[na[0]][0]=range[na[0]][1]=na[na[0]];
  for (int i=na[0]-1; i>0; i--) {
    range[i][0]=0, range[i][1]=na[i]-1;
    ret = (ret+calc(range, na[0]))%MODS;
    range[i][0]=range[i][1]=na[i];
  }
  ret = (ret+calc(range, na[0]))%MODS;
  return ret;
}

int main() {
#ifdef DEBUG
  freopen("1.in", "r", stdin);
  freopen("1.out", "w", stdout);
#endif

  long long l, r;
  scanf("%lld %lld", &l, &r);
  printf("%lld", (count(r)-count(l-1)+MODS)%MODS);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
